<select name="<?php echo $name ?>" id="<?php echo  isset($id) ? $id : $name ?>" autocomplete="off">
    <option value="0">请选择</option>
    <?php
    foreach ($grades as $grade) {
    ?>
        <option value="<?php echo $grade['id'] ?>"> <?php echo $grade['title'] ?></option>
    <?php
    }
    ?>
</select>